// 整个项目api的管理

import request from "./request";
export default {
    //home组件 左侧表格数据获取
    getTableData(parms){
        return request({
            url:'/home/getTableData',
            method:'get',
            data:parms,
            mock:true
        })
    },
    getCountData(){
        return request({
            url:'/home/getCountData',
            method:'get',
            mock:true
        })
    },
    getChartData(){
        return request({
            url:'/home/getChartDate',
            method:'get',
            mock:true
        })
    },
    getUser(params){
        return request({
            url:'http://127.0.0.1:8080/user/get',
            method:'get',
            mock:false,
            data:params
        })
    },
    searchUser(params){
        return request({
            url:'http://127.0.0.1:8080/user/search',
            method:'get',
            mock:false,
            data:params
        })
    },
    addUser(params){
        return request({
            url:'http://127.0.0.1:8080/user/add',
            method:'post',
            mock:false,
            data:params,
        })
    },
    editUser(params){
        return request({
            url:'/user/editUser',
            method:'post',
            mock:false,
            data:params
        })
    },
    deleteUser(params){
        return request({
            url:'http://127.0.0.1:8080/deleteEmail',
            method:'post',
            mock:false,
            data:params,
            dataName:'userId'
        })
    },
    //根据用户的用户名不同，返回不一样的菜单列
    getMenu(params){
        return request({
            url:'http://127.0.0.1:8080/loginEmail',
            method:'post',
            mock:false,
            data:params
        })
    },
    //获取博客数据
    // getBlog(params){
    //     return request({
    //         url:'/article/getBlog',
    //         method:'get',
    //         mock:false,
    //         data:params
    //     })
    // }
    getBlog(params){
        return request({
            url:'http://127.0.0.1:8080/blog_content/get',
            method:'get',
            mock:false,
            data:params
        })
    },
    deleteBlog(params) {
        return request({
            url:'http://127.0.0.1:8080/blog_content/delete',
            method:'post',
            mock:false,
            data:params,
            dataName:'blogId'
        })
     }
    
}